function reverseArr<T, U>(a: [T, U]): U[] {
    return [a[1]]
}

console.log(reverseArr(['123', 456]));


function map<input, output>(arr: input[], fn: (item: input, index: number, arr: input[]) => output): output[] {
    return arr.map(fn);
}

function zzz(item: string, index: number, arr: string[]) {
    console.log(item, index, arr);

    return item;
}

const sr = map(['1', '2', '3'], zzz);
console.log(sr);
  